<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F().css</title>
<link type="text/css" rel="stylesheet" href="../css/admin.css" />
<link type="text/css" rel="stylesheet" href="../css/item_show.css" />
<script type="text/javascript" src="../../1st.js"></script>
<script type="text/javascript" src="../../1st.highlight.js"></script>
</head>
<body id="split">
<div id="content">
	<div rel="F.param">
		<h2><span>返回值:</span>F().css</h2>
					<h3>概述 : 设置或获取样式</h3>
						
			<div class="desc">
				<div class="longdesc"><pre>灵活设置CSS样式：
可以用单个name/value对应的写法，也可以多个，
可以用object多个name/value的形式，也可以用冒号分号隔离串的形式，
样式名支持font-size等中间有横杠的格式；</pre></div>
			</div>
							<h3>语法1：F().css(key,val)</h3>
						<table class="args">
				<!--caption>参数列表：(2)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>key</strong></td><td>String</td><td>CSS属性名</td></tr>
									<tr><td><strong>val</strong></td><td>String,Number</td><td>CSS属性值</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回DOM链</td></tr>
			</table>
					<h3>语法2：F().css(cssText)</h3>
						<table class="args">
				<!--caption>参数列表：(1)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>cssText</strong></td><td>String</td><td>key1:value1;key2:value2;...keyn:valuen; 的形式</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回DOM链</td></tr>
			</table>
					<h3>语法3：F().css(json)</h3>
						<table class="args">
				<!--caption>参数列表：(1)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>json</strong></td><td>Object</td><td>{key1:value1,key2:value2,...keyn:valuen} 的形式</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>fdom</td><td>返回DOM链</td></tr>
			</table>
					<h3>语法4：F().css(key)</h3>
						<table class="args">
				<!--caption>参数列表：(1)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>key</strong></td><td>String</td><td>CSS属性名</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>String</td><td>返回CSS属性值</td></tr>
			</table>
				<div class="example">
			<h3>示例 : </h3>
						
							<h5 xmlns="">HTML代码:</h5>
				<pre xmlns=""><code id="htmlbox"></code></pre>
									
				<h5 xmlns="">JS代码:</h5>
				<pre xmlns=""><code id="jsbox"></code></pre>
										
				<h5 xmlns="">结果:</h5>
				<pre xmlns=""><code id="resultbox"></code><code></code></pre>
					</div>
		<div style="text-align:right">
			
					
				<button onclick="window.open('../codepages/13.html');">运行代码</button>
						
		</div><br/>	
		<div>
			<h3>同类参考 :</h3>
			<div>
							<span><a href='153.html'>F().px</a></span>&#12288;|&#12288;							<span><a href='16.html'>F().cls</a></span>&#12288;|&#12288;							<span><a href='160.html'>F().float</a></span>&#12288;|&#12288;							<span><a href='130.html'>F().ps</a></span>&#12288;|&#12288;							<span><a href='20.html'>F().opacity</a></span>&#12288;|&#12288;							<span><a href='94.html'>F().align</a></span>&#12288;|&#12288;							<span><a href='149.html'>F().border</a></span>&#12288;|&#12288;							<span><a href='180.html'>F().cursor</a></span>						</div>
		</div>
	</div>
</div><br />

<textarea id="css" style="display:none;"></textarea>
<textarea id="html" style="display:none;"><div id="box">testbox</div></textarea>
<textarea id="js" style="display:none;">//F("box").css("width","100px").css("height","50px").css("backgroundColor","red").css("color","blue"); //用法一
F("box").css("width:100px; height:50px; font-weight:bold; background-color:red; color:blue;"); //用法二
//F("box").css({width:"100px", height:"50px", fontWeight:"bold", backgroundColor:"red", color:"blue"}); //用法三
alert(F("box").css("width"));//用法四</textarea>
<textarea id="result" style="display:none;">"100px"</textarea>


<script type="text/javascript">
var css = F('css').val();
var html = F('html').val();		
var js = F('js').val();
var result = F('result').val();
css && F('cssbox').highlight(css, "css");
html && F('htmlbox').highlight(html, "html");
js && F('jsbox').highlight(js, "js");
result && F('resultbox').highlight(result,"js");
</script>

</body>
</html>